<template>
  <el-container>

    <el-header style="background-color: #000000;">考勤时间管理</el-header>
    <br><br>
    <el-form ref="form" :model="form" label-width="80px">
    </el-form-item>
      <el-form-item label="出勤时间">
        <el-col :span="10">
          <el-time-picker placeholder="选择时间" v-model="schedule.scheduleWorkTime" type="date"
            value-format="yyyy-MM-dd HH:mm:ss" formate="yyyy-MM-dd HH:mm:ss" style="width: 30%;">
          </el-time-picker>
        </el-col>
      </el-form-item>
      <el-form-item label="退勤时间">
        <el-col :span="10">
          <el-time-picker placeholder="选择时间" v-model="schedule.scheduleQuitTime" type="date"
            value-format="yyyy-MM-dd HH:mm:ss" formate="yyyy-MM-dd HH:mm:ss" style="width: 30%;">
          </el-time-picker>
        </el-col>
      </el-form-item>
      <el-button type="primary" @click="onSubmit">提交信息</el-button>
      <el-button type="primary" @click="reset">重置信息</el-button>
      <!-- <el-button type="primary" @click="test">test</el-button> -->

      </el-form-item>
    </el-form>
  </el-container>

</template>

<script>
  export default {
    data() {
      return {
        schedule: {
          scheduleWorkTime: '',
          scheduleQuitTime: '',
          scheduleId: 1
        }
      }
    },
    methods: {
      reset() {
        this.schedule.scheduleWorkTime = "";
        this.schedule.scheduleQuitTime = "";
      },
      onSubmit() {
        this.$confirm("你确定要提交吗", "提示");
        // console.log(this.schedule);
        var self = this;
        this.$http.post("http://localhost:8080/schedule/updateSystem", this.$qs.stringify(this.schedule))
          .then(function(res) {
            self.$message(res.data.info);
          })
      },
      // test(){
      //   var i = 1;
      //   var self = this;
      //   console.log(i);
      //   this.$http.get(
      //     "http://localhost:8080/schedule/test",{
      //       params:{
      //         "i":1
      //       }
      //     }
      //   )
      //   .then(function(res){
      //     // self.$message(res.data.info);
      //   })
      // }
    },
    mounted() {}
  }
</script>

<style>
</style>
